package com.edu.rabbitmq;

import java.io.Serializable;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 
 * <p>
 * Description: 消息模型
 * </p>
 * 
 * @author wanjianeng
 * @createTime 2017年3月30日 下午2:46:34
 * @version 1.0
 *
 */
public class CommonMessage<T> implements Serializable{

	private static final long serialVersionUID = 1L;
	
	/**
	 * 约定的几个消息源名称
	 */
	private String sourceName;
	/**
	 * 实体表名
	 */
	private String tableName;
	/**
	 * 主键
	 */
	private String primaryKey;
	/**
	 * 消息实体bean
	 */
	private T message;

	public String getSourceName() {
		return sourceName;
	}


	public void setSourceName(String pSourceName) {
		sourceName = pSourceName;
	}


	public String getTableName() {
		return tableName;
	}


	public void setTableName(String pTableName) {
		tableName = pTableName;
	}


	public String getPrimaryKey() {
		return primaryKey;
	}


	public void setPrimaryKey(String pPrimaryKey) {
		primaryKey = pPrimaryKey;
	}


	public T getMessage() {
		return message;
	}


	public void setMessage(T pMessage) {
		message = pMessage;
	}


	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.DEFAULT_STYLE);
	}
	
}
